<?php
use Workerman\Worker;
use \Workerman\MySQL\Connection;
use Workerman\Connection\TcpConnection;
require_once __DIR__ . '/vendor/autoload.php';


$my_conn = new Connection("127.0.0.1", '3306', 'root', '', 'chat');

$tb = "yi_user";
$param["user_id"] = 100040;
$friend = $my_conn
              ->select("yi_user.fd")
              ->from("yi_friend")
              ->innerJoin("yi_user", "yi_user.id=yi_friend.friend_id")
              ->where("yi_friend.user_id = 100040")
              ->where("yi_friend.status = 0")
              ->where("yi_user.status = 1")
              ->column();
var_dump($friend);

$sql = "SELECT b.fd FROM yi_friend a INNER JOIN yi_user b ON a.friend_id=b.id WHERE a.user_id=100022 AND a.status=0 AND b.status=1";
$list = $my_conn->query($sql);
print_r($list);